package com.wx.chapter11.enum_;

/**
 * @Author : 佩萁
 * Description :
 * @Create : 2023/6/13 - 9:23
 */
public class Enumeration01 {
    public static void main(String[] args) {
        System.out.println(Season.SPRING);
    }
}

class Season {
    private String name;
    private String desc;//季节描述

    //定义四个对象，
    public static final Season SPRING = new Season("春天", "温暖");
    public static final Season SUMMER = new Season("夏天", "炎热");
    public static final Season ANTUMN = new Season("秋天", "凉爽");
    public static final Season WINTER = new Season("冬天", "寒冷");

    //构造器设置为私有，为了外部其他类不能随便创建对象
    private Season(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    //枚举不能提供seter方法，因为不能修改固定的对象属性
    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }
}